package com.ywu.wiki.standard.api;

import com.ywu.common.result.CommonResult;
import com.ywu.wiki.standard.dto.YwuWikiProjectDto;
import com.ywu.wiki.standard.service.YwuWikiProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName YwuWikiProjectApi
 * @Description TODO
 * @Author GroundDemo
 * @Date 2024/9/20 20:35
 * @Version 1.0
 **/
@RestController
@RequestMapping("/ywu/wiki/project")
public class YwuWikiProjectApi {
    @Autowired
    private YwuWikiProjectService service;

    /**
    * @Author GroundDemo
    * @Description 添加项目信息
    * @Date 22:04 2024/9/20
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/add.project.info")
    public CommonResult<Object> addWikiProject(@RequestBody YwuWikiProjectDto dto) {
        return service.addWikiProject(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 更新项目信息
    * @Date 22:15 2024/9/20
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/update.project.info")
    public CommonResult<Object> updateWikiProject(@RequestBody YwuWikiProjectDto dto) {
        return service.updateWikiProject(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 删除项目信息
    * @Date 22:22 2024/9/20
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/delete.project.info")
    public CommonResult<Object> deleteWikiProject(@RequestBody YwuWikiProjectDto dto) {
        return service.deleteWikiProject(dto);
    }

    /**
    * @Author GroundDemo
    * @Description 分页查询项目数据
    * @Date 22:24 2024/9/20
    * @Param [dto]
    * @return com.ywu.common.result.CommonResult<java.lang.Object>
    **/
    @PostMapping("/query.project.page.list")
    public CommonResult<Object> queryPageList(@RequestBody YwuWikiProjectDto dto) {
        return service.queryPageList(dto);
    }

    /**
     * @Author GroundDemo
     * @Description 查询所有项目信息
     * @Date 22:24 2024/9/20
     * @Param [dto]
     * @return com.ywu.common.result.CommonResult<java.lang.Object>
     **/
    @PostMapping("/query.all.project.info")
    public CommonResult<Object> queryAllProject() {
        return service.queryAllProject();
    }
}
